<template>
  <div class="app-container-flex">
    <NewFullScreen v-model="showDialog" :title="title">
      <div class="model-panel">
        <div class="model-panel-title">
          <p>{{ $t('basic_information') }}</p>
        </div>
        <div class="model-panel-body">
          <basic-information :info="infoList"></basic-information>
        </div>
      </div>
    </NewFullScreen>
  </div>
</template>

<script setup name="details">
const { proxy } = getCurrentInstance()
const emits = defineEmits()
const props = defineProps(['visible', 'tableRow'])

const title = ref('部门详情')
const infoList = ref({
  data: {},
  fieldList: [
    { label: '部门名称', value: 'name' },
    { label: '部门编码', value: 'code' },
    { label: '允许使用所有产品', value: 'ownAllProductValue' },
  ],
})

const showDialog = computed({
  get() {
    return props.visible
  },
  set(newValue) {
    emits('update:visible', newValue) // 更新父组件visible
  },
})

onMounted(() => {
  infoList.value.data = props.tableRow
})
</script>

<style scoped></style>
